package com.bocloud.cmp.dao;

import java.util.List;
import java.util.Map;

import com.bocloud.cmp.entity.resource.Vdc;
import com.bocloud.common.model.Param;
import com.bocloud.common.model.SimpleBean;
import com.bocloud.database.core.intf.GenericDao;

/**
 * 虚拟数据中心数据操作接口
 * 
 * @author weiwei
 * @version 1.0
 * @since 2016.12.28
 *
 */
public interface VdcDao extends GenericDao<Vdc, Long> {

	/**
	 * 列表
	 * 
	 * @param page
	 *            the page
	 * @param rows
	 *            the rows
	 * @param params
	 *            the params
	 * @param sorter
	 *            the sorter
	 * @return the pool list
	 * @throws Exception
	 */
	public List<Vdc> list(int page, int rows, List<Param> params, Map<String, String> sorter) throws Exception;

	/**
	 * 简易列表
	 * 
	 * @param params
	 *            the params
	 * @param sorter
	 *            the sorter
	 * @return the bean
	 * @throws Exception
	 */
	public List<SimpleBean> list(List<Param> params, Map<String, String> sorter) throws Exception;

	/**
	 * 删除
	 * 
	 * @param id
	 *            the id
	 * @param userId
	 *            the user id
	 * @return
	 * @throws Exception
	 */
	public boolean remove(Long id, Long userId) throws Exception;

	/**
	 * 数量
	 * 
	 * @param params
	 *            the params
	 * @return count
	 * @throws Exception
	 */
	public int count(List<Param> params) throws Exception;

	/**
	 * 根据ID查询
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public Vdc query(Long id) throws Exception;

	/**
	 * 根据供应商Id删除
	 * 
	 * @param vendorId
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public boolean removeByVendor(Long vendorId, Long userId) throws Exception;

	/**
	 * 根据供应商Id查询
	 * 
	 * @param vendorId
	 * @return
	 * @throws Exception
	 */
	public List<Vdc> listByVendor(Long vendorId) throws Exception;

}
